<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="referrer" content="origin-when-cross-origin">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智慧后勤服务</title>
    <link href="./css/common.css" rel="stylesheet">
    <link href="./css/index.css" rel="stylesheet">
</head>
<body>
    <div class="header">
        <div class="content">
            <img class="logo" src="./img/logo_top.png">
            <span class="sysname">
                <p class="cir"></p>
                智慧后勤服务
            </span>
            <div class="user-info">
                <img class="head" src="./img/head.png" alt="头像">
                <span class="user-name" id="username"></span>
            </div> 
        </div>
    </div>
    <div class="banner">
        <img src="./img/banner.jpg" >
    </div>
    <div class="menu-items">
        <div class="menu-box">
            <div class="menu-head">
                <span class="head-name">后勤服务</span>
            </div>
            <div class="items">
                <a href="javascript:void(0);" buss="baox" page="form">
                    <div class="btn"> 
                        <img src="./img/wybx.png">
                        <div class="txt">
                            <div class="t1">报修服务</div>
                            <div class="t2">申请服务</div>
                        </div>
                        <div class="times">
                            <span id="baox_apply_times"></span>次访问
                        </div>
                    </div>
                </a>
                <a href="javascript:void(0);"  buss="gongcyy" page="form">
                    <div class="btn"> 
                        <img src="./img/gcyy.png">
                        <div class="txt">
                            <div class="t1">公车预约</div>
                            <div class="t2">申请服务</div>
                        </div>
                        <div class="times">
                            <span id="gcyy_apply_times"></span>次访问
                        </div>
                    </div>
                </a>
                <a href="javascript:void(0);" buss="jiazfw" page="form">
                    <div class="btn"> 
                        <img src="./img/jzfw.png">
                        <div class="txt">
                            <div class="t1">家政服务</div>
                            <div class="t2">申请服务</div>
                        </div>
                        <div class="times">
                            <span id="jzfw_apply_times"></span> 次访问
                        </div>
                    </div>
                </a>
            </div>
        </div>

        <div class="menu-box">
            <div class="menu-head">
                <span class="head-name">我的后勤服务</span>
            </div>
            <div class="items">
                <a href="javascript:void(0);" buss="baox" page="list">
                    <div class="btn list"> 
                        <img src="./img/baoxjl.webp">
                        <div class="txt">
                            <div class="t1">我的报修服务</div>
                            <div class="t2">服务记录</div>
                        </div>
                        <div class="times">
                            <span id="baox_list_times"></span>次访问
                        </div>
                    </div>
                </a>
                <a href="javascript:void(0);" buss="gongcyy" page="list">
                    <div class="btn list"> 
                        <img src="./img/yuyue.webp">
                        <div class="txt">
                            <div class="t1">我的公车预约</div>
                            <div class="t2">服务记录</div>
                        </div>
                        <div class="times">
                            <span id="gcyy_list_times"></span>次访问
                        </div>
                    </div>
                </a>
                <a href="javascript:void(0);" buss="jiazfw" page="list">
                    <div class="btn list"> 
                        <img src="./img/jiazheng.webp">
                        <div class="txt">
                            <div class="t1">我的家政服务</div>
                            <div class="t2">服务记录</div>
                        </div>
                        <div class="times">
                            <span id="jzfw_list_times"></span>次访问
                        </div>
                    </div>
                </a>
            </div>
        </div>
    </div>
    <div class="footer">
        <div  class="copyright">西安建筑科技大学©版权所有</div>
    </div>
    <script src="./plugin/jquery-2.0.0.min.js"></script>
    <script src="./js/config.js"></script>
    <script src="./api.js?1"></script> 
    <script src="./mock/data.js"></script> 
    <script>
        $(function(){
            API.getUerInfo(function(data){
                // //console.log(data)
                $("#username").html(data.os_u_full_name)
                localStorage.setItem("os_u_name",data.os_u_name);
                localStorage.setItem("os_u_phone",data.os_u_phone); 
                localStorage.setItem("os_u_full_name",data.os_u_full_name);
            });
            $(".items a").click(function(){
                var buss=$(this).attr("buss");
                var page=$(this).attr("page");
                window.location.href="./view/"+buss+"/"+page+".html";
            });

            var timeModels =[
                {
                    type:'报修服务',
                    id:"baox_apply_times"
                },{
                    type:'公车预约',
                    id:"gcyy_apply_times"
                },{
                    type:'家政服务',
                    id:"jzfw_apply_times"
                },{
                    type:'报修服务记录',
                    id:"baox_list_times"
                },{
                    type:'公车预约记录',
                    id:"gcyy_list_times"
                },{
                    type:'家政服务记录',
                    id:"jzfw_list_times"
                },
            ]; 
            timeModels.forEach(element => {
                API.getClickTimes(element.type,function(json){
                    if (json.code != "0") {
                        layer.alert(json.codemessage) ;
                    }else{ 
                        $("#"+element.id).html(json.times);
                    }	
                });
            });
        });
    </script>
</body>
</html>